package com.xkdx.caipiao.presistence.redrecharge;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xkdx.caipiao.module.network.AbsModule;

public class RedRechargeModule extends AbsModule {
	public String tn,paydata,url;
	@Override
	public void parseData() throws Exception {
		try {
			backJson = (JSONArray) result;
			for (int i = 0; i < backJson.size(); i++) {
				jsonObj = (JSONObject) backJson.get(i);
				String sortOfAct = jsonObj.getString("Act");
				if (sortOfAct.equals("PayPacket")) {
					parseRecharge(jsonObj.getJSONObject("DetailInfo"));
				} 

			}
		} catch (Exception e) {
			// to do define a exception include all parseException
			throw e;
		}

	}
	
//	 "DetailInfo":{
//        "paydata":"dG49MjAxNDA3MDQxNzIwMzQwMDc2MjYyLHJlc3VsdFVSTD1odHRwJTNBJTJGJTJGMTE4LjI0NC4y%0AMDguMyUzQTgwMDAlMkYxJTJGdXBtcHBheSUyRnJlZGlyZWN0JTNGYXBwdXJsJTNEaHR0cCUzQSUy%0ARiUyRjE3Mi4xNi4yNC4zMyUyRmNwJTJGJTI2Y29kZSUzRCx1c2V0ZXN0bW9kZT10cnVl%0A",
//        "tn":"201407041720340076262"
//    },
	
	private void parseRecharge(JSONObject person) throws Exception {
		try {
			tn=person.getString("tn");
			paydata=person.getString("paydata");
			url=person.getString("url");
		} catch (Exception e) {
			throw e;
		}
	
	}

}
